package com.erlin.store.controller.param;

import com.erlin.common.validator.constraints.Ranges;
import com.erlin.store.constant.StoreConfigConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @date 2021/5/31 9:37 下午
 * @Author alin
 */
@Getter
@Setter
@ApiModel("商店配送配置")
public class StoreDistanceConfigParam implements Serializable {
    @ApiModelProperty("store mid")
    @NotBlank
    private String storeMid;
    @ApiModelProperty("配置信息")
    @NotEmpty
    private List<config> configs;

    @Getter
    @Setter
    @ApiModel("具体配置")
    public static class config{
        @ApiModelProperty("距离 LTO小于1公里 OTT(1-3)公里 SC(同城) IC(城际)")
        @NotBlank
        private String distanceType;
        @ApiModelProperty("配送价格")
        private BigDecimal price = BigDecimal.ZERO;
        @ApiModelProperty("满减价格")
        private BigDecimal reductionAmout;
        @ApiModelProperty("满减后价格")
        private BigDecimal reducePrice;
        @ApiModelProperty("配送形式：1自送 2快递 3三方 4其他")
        @Ranges(ranges = {StoreConfigConstant.DILIVERY_SELF, StoreConfigConstant.DILIVERY_POST,StoreConfigConstant.DILIVERY_TRIPARTITE,StoreConfigConstant.DILIVERY_OTHER})
        private Integer deliveryMode;
        @ApiModelProperty("配送到达地点 1家 2小区门口")
        @Ranges(ranges = {StoreConfigConstant.LOCATION_HOME,StoreConfigConstant.LOCATION_ENTRANCE})
        private Integer deliveryLocation;
        @ApiModelProperty("配送时间")
        private Integer deliveryTime = 30;
    }
}
